<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>垂直卡片滑动动画</title>
    <link rel="stylesheet" href="index.css">
</head>
<body>
    <div class="container">
        <!-- --d是自定义属性,可通过var函数对其调用 -->
        <div class="card" style="--d:-1">
            <div class="content">
                <div class="img">
                    <img src="./images/1.jpeg" alt="">
                </div>
                <div class="detail">
                    <span>路飞</span>
                    <p>草帽海贼团船长</p>
                </div>
            </div>
            <a href="#">关注</a>
        </div>

        <div class="card" style="--d:0">
            <div class="content">
                <div class="img">
                    <img src="./images/2.jpeg" alt="">
                </div>
                <div class="detail">
                    <span>索隆</span>
                    <p>草帽海贼团剑士</p>
                </div>
            </div>
            <a href="#">关注</a>
        </div>

        <div class="card" style="--d:1">
            <div class="content">
                <div class="img">
                    <img src="./images/3.jpeg" alt="">
                </div>
                <div class="detail">
                    <span>山治</span>
                    <p>草帽海贼团厨师</p>
                </div>
            </div>
            <a href="#">关注</a>
        </div>

        <div class="card" style="--d:2">
            <div class="content">
                <div class="img">
                    <img src="./images/4.jpeg" alt="">
                </div>
                <div class="detail">
                    <span>娜美</span>
                    <p>草帽海贼团海士</p>
                </div>
            </div>
            <a href="#">关注</a>
        </div>

        <div class="card" style="--d:3">
            <div class="content">
                <div class="img">
                    <img src="./images/5.jpeg" alt="">
                </div>
                <div class="detail">
                    <span>乌索普</span>
                    <p>草帽海贼团狙击手</p>
                </div>
            </div>
            <a href="#">关注</a>
        </div>
    </div>
</body>
</html>